import apiService from "./apiService";

const berries = {
  async getBerries(idOrName) {
    try {
      const res = await apiService.get(`/berry/${idOrName}`);
      return res.data;
    } catch (error) {
      throw error;
    }
  },

  // async createUser(userData) {
  //   try {
  //     const res = await apiService.post("/users", userData);
  //     return res.data;
  //   } catch (error) {
  //     throw error;
  //   }
  // },
};

const contests = {
  async getContestType(idOrName) {
    try {
      const res = await apiService.get(`/contest-type/${idOrName}`);
      return res.data;
    } catch (error) {
      throw error;
    }
  },
};

const games = {
  async generations(idOrName) {
    try {
      const res = await apiService.get(`/generation/${idOrName}`);
      return res.data;
    } catch (error) {
      throw error;
    }
  },
};

const pokeService = {
  berries,
  contests,
  games,
};

export default pokeService;
